package com.wyf.order.config;

import com.wyf.order.intercptor.feign.CustomFeignInterceptor;
import feign.Contract;
import feign.Logger;
import feign.Request;
import feign.RequestInterceptor;
import feign.auth.BasicAuthRequestInterceptor;
import org.bouncycastle.crypto.ec.CustomNamedCurves;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 全局配置：当使用@Configuration 会将配置作用所有的服务提供方
 * 局部配置：如果只想针对某一个服务进行配置，就不要加
 */
@Configuration
public class FeignConfig {

    // @Bean
    // public Logger.Level feignLoggerLevel() {
    //     return Logger.Level.FULL;
    // }

    /**
     * 修改契约配置，支持Feign原生注解
     * @return
     */
    // @Bean
    // public Contract feignContract() {
    //     return new Contract.Default();
    // }

    // @Bean
    // public Request.Options options() {
    //     return new Request.Options(5000, 10000);
    // }

    @Bean
    public CustomFeignInterceptor customFeignInterceptor() {
        return new CustomFeignInterceptor();
    }
}
